<?
session_start();
if(empty($_GET['user_name'])) {
	exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>呼损查询</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../webkit/utils/jquery.js"></script>
<script type="text/javascript" src="../../../webkit/grid/import.js"></script>
<script type="text/javascript" src="../../../webkit/dialog/import.js"></script>
<script type="text/javascript" src="../../../webkit/datepicker/WdatePicker.js"></script>
</head>
<body bgccolor="#f4f4f4" style="margin:0px;overflow-x:hidden">

<table width=100% height=100% cellspacing=0 cellpadding=0>
	<tr bgcolor="white">
	<form name=f>
	<td height=30>
	呼叫时间：<input type="text" id="date_start" name="date_start" onClick="WdatePicker({readOnly:true, skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" size="15" value=""> - <input type="text" id="date_end" name="date_end" onClick="WdatePicker({readOnly:true, skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" size="15" value="">　
	<input type="button" value="查询" onclick="search()">　
	</td>
	</tr>
	<tr>
	<td>
		<table id="flex1" style="display:none"></table>
	</td>
	</form>
	</tr>
</table>

<script>
	var user_name = "<?echo $_GET['user_name']?>";

	var h = window.screen.height-(120+330); // 属于嵌入外部url，只能按screen高度大致计算
	//alert(h)
	if(h < 0) h = 'auto'
	$("#flex1").flexigrid({
		url: 'missing_call_query.php?action=list&user_name='+user_name,
		dataType: 'json',
		colModel : [
			{display: 'ID', name : 'a', width : 30, sortable : false, align: 'center'},
			{display: '主叫号码', name : 'a', width : 150, sortable : false, align: 'center'},
			{display: '被叫号码', name : 'a', width : 150, sortable : false, align: 'center'},
			{display: '呼叫时间', name : 'b', width : 150, sortable : false, align: 'center'},
			{display: '等待时长(秒)', name : 'b', width : 150, sortable : false, align: 'center'},
			{display: '所属用户', name : 'c', width : 150, sortable : true, align: 'center'}
			],
		/*buttons : [
			{name: '导出数据', bclass: 'other', onpress : export_excel}
		],*/
		async : true,
		usepager: true,
		title: '呼损列表',
		useRp: true,
		rp: 8,
		showTableToggleBtn: false,
		width: 'auto',
		height: h,
		resizable : false,
		singleSelect : true
	});

	<?
	$add_url = "call_panel.php?op=add";
	$edit_url = "call_panel.php?op=edit&id="; 
	$del_url = "call_query.php?action=del&id=";
	$dlg_size = "980, 400";
	require("../../grid_common_js.php");
	?>

    /*$('#flex1').dblclick( function (e) { 
        select_row_on_dblclick(e);
        edit();
    });*/


	function search() { 
		var url = "client_query.php?action=list&user_name="+user_name;
        if($("#date_start").val()!="" && $("#date_end").val()!="") {
            url += "&date_range="+ $("#date_start").val() +"_"+ $("#date_end").val();
        }          
		$('#flex1').flexOptions({'url': url}).flexReload(); 
	}

</script>
</body>
</html>